import selfAxios from '@/utils/selfAxios.js';

export default {
    //获取供应商数据列表
    getList() {
        return selfAxios({
            url: '/supplier/list',
            method: 'get'
        })
    },
    //获取供应商数据列表和查询供应商信息
    search(page, size, searchMap) {
        return selfAxios({
            url: `/supplier/list/${page}/${size}`,
            method: 'post',
            data: searchMap
        })
    },
    //添加供应商数据
    add(Sprdata) {
        return selfAxios({
            url: '/supplier',
            method: 'post',
            data: Sprdata
        })
    },
    //通过ID获取供应商信息
    geSprMessageByID(id) {
        return selfAxios({
            url: `/supplier/${id}`,
            method: 'get',

        });
    },
    //更新供应商信息
    upDate(id, upDatedData) {
        return selfAxios({
            url: `/supplier/${id}`,
            method: 'put',
            data: upDatedData
        });
    },
    delData(id) {
        return selfAxios({
            url: `/supplier/${id}`,
            method: 'delete'
        })
    }
}